int numDecodings(char * s){
    if (s[0] == '0') return 0;
    int len = strlen(s);
    int dp[len+1];
    dp[0] = 1; dp[1] = 1;

    for (int i = 1; i < len; i++) {
        if (s[i] == '0') {
            if (s[i-1] == '1' || s[i-1] == '2') dp[i+1] = dp[i - 1];    // 跨过0
            else return 0;  // 大于26
        }
        else {
            // 可以组合成两位数
            if (s[i-1] == '1' || (s[i-1] == '2' && (s[i] >= '0' && s[i] <= '6')))
                dp[i+1] = dp[i] + dp[i-1];
            else 
                dp[i+1] = dp[i];
        }
    }
    return dp[len];
}